<script>
export default {
	onLaunch: function () {
		console.log('App Launch');
		// uni.getStorageSync('token');
		this.$request('front/user/getRole').then((res1) => {
			console.log(res1, '身份');
			if (res1.obj === -1) {
				this.$store.commit('setidentity', 1);
				this.$tools.navigiteTo('/pages/index/index');
			}
			if (res1.obj === 0) {
				this.$store.commit('setidentity', 2);
				this.$tools.navigiteTo('/pages1/index/index');
			}
			if (res1.obj === 1) {
				this.$store.commit('setidentity', 3);
				this.$tools.navigiteTo('/pages2/index/index');
			}
		});
	},
	onShow: function () {
		console.log('App Show');
		// console.log(this.$store.state.identity);
	},
	onHide: function () {
		console.log('App Hide');
	}
};
</script>

<style lang="scss">
@import '@/uni_modules/uview-ui/index.scss';
/*每个页面公共css */
@import 'style/flex.css';
@import 'style/base.css';
@import 'style/position.css';
@import 'style/text.css';
</style>
